package com.dubbo.consumer.AccountController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.CarBalance.AccountPayBillsService;
import com.dubbo.common.dtos.ResponseResult;
import com.dubbo.model.balance.dtos.*;
import com.dubbo.model.balance.pojos.AccountAccessories;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("PayBills")
public class AccountPayBillsController {

    @Reference(check = false)
    private AccountPayBillsService service;

    @GetMapping("unpaidAll")
    public ResponseResult<List<UnpaidDto>> unpaid(@RequestBody UnPayQueryDto dto){
        return service.unpaid(dto);
    }

    @GetMapping("paidAll")
    public ResponseResult<List<PaidDto>> payQuery(@RequestBody payQueryDto dto){
        return service.payQuery(dto);
    }

    @GetMapping("payDetail/{id}")
    public ResponseResult<AccountDetailDto> payDetail(@PathVariable("id") String id){
        return service.payDetail(id);
    }

    @GetMapping("pay")
    public ResponseResult<List<AccountAccessPayResultDto>> pay(@RequestBody AccountAccessoriesPayDto dto){
        System.out.println(111);
        return service.pay(dto);
    }
}
